package com.ybkj.chat.net.api;

import com.ybkj.chat.bean.BaseResponse;
import com.ybkj.chat.bean.request.LoginReq;
import com.ybkj.chat.bean.request.ModifyPassReq;
import com.ybkj.chat.bean.request.ModifyReq;
import com.ybkj.chat.bean.request.PhoneNumberRes;
import com.ybkj.chat.bean.response.LoginRes;
import com.ybkj.chat.bean.response.MineDataRes;
import com.ybkj.chat.bean.response.VersionRes;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * - @Author:  Yi Shan Xiang
 * - @Description:  ApiService
 * - @Time:  2018/8/31
 * - @Emaill:  380948730@qq.com
 */
public interface ApiService {

    /**
     * 用户登录
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("userLogin")
    Observable<BaseResponse<LoginRes>> startLogin(
            @Field("phoneCode") String phoneCode,
            @Field("phoneNumber") String phoneNumber,
            @Field("password") String password
            );

    /**
     * 找回密码
     *
     * @return
     */
    @POST("userApp/frogetPassword/froget")
    Observable<BaseResponse<Object>> forgetPass(@Body ModifyPassReq modifyPassReq);

    /**
     * 修改默认密码
     *
     * @returna
     */
    @POST("userApp/resetPassword//updatePwd")
    Observable<BaseResponse<Object>> modifyNormalPwd(@Body ModifyPassReq modifyPassReq);


    /**
     * 我的
     *
     * @return
     */
    @POST("userApp/myInfo/show")
    Observable<BaseResponse<MineDataRes>> getMineData();

    /**
     * 修改密码
     *
     * @return
     */
    @POST("userApp/myInfo/modifyPwd")
    Observable<BaseResponse<MineDataRes>> modifyPsd(@Body ModifyReq req);

    /**
     * 获取验证码
     */
    @POST("SendCode")
    Observable<BaseResponse<Object>> getVerificationCode(@Query("userPhoneNumber") String userPhoneNumber);

    /**
     * 修改手机号码
     *
     * @param req
     * @return
     */
    @POST("userApp/myInfo/modifyPhone")
    Observable<BaseResponse<Object>> modifyPhone(@Body ModifyReq req);


    /**
     * 版本更新
     *
     * @return
     */
    @GET("/app/agent/versions")
    Observable<BaseResponse<VersionRes>> getVersion();

    /**
     * 修改账号
     *
     * @param
     * @return
     */
    @POST("userApp/myInfo/modifyUserAccount")
    Observable<BaseResponse<Object>> modifyAccount(@Body ModifyReq req);

    @POST("PhoneNumberLogin")
    Observable<BaseResponse<PhoneNumberRes>> phoneNumberLogin(@Query("userPhoneNumber") String userPhoneNumber,
                                                              @Query("codeNumber") String codeNumber,
                                                              @Query("type") int type);
}
